import request from '../utils/request'

/**
 * 获取商品数据
 * @param {String} id
 * @returns
 */
export function findGoods(id) {
    return request('/goods', 'get', { id })
}

/**
 * 同类推荐(也支持猜你喜欢)
 * @param {*} id 商品id
 * @returns
 */
export function findRelevant({ id, limit = 16 }) {
    return request('/goods/relevant', 'get', { id, limit })
}
/**
 * 获取热门推荐商品
 * @param {*}
 * @returns
 */
export function findGoodsHot({ id, limit = 3, type }) {
    return request('/goods/hot', 'get', { id, limit, type })
}

/**
 * 获取商品评价标题
 * @param {String} id 商品id
 * @returns
 */
export function findCommentInfo(id) {
    return request(`/goods/${id}/evaluate`, 'get')
}

export function findCommentList(id, params) {
    return request('/goods/:id/evaluate/page', 'get', { id, params })
}